package com.chuanke.ckfamily.dao.social;

import com.chuanke.ckfamily.dao.base.Page;
import com.chuanke.ckfamily.dao.social.model.Family;
import com.chuanke.ckfamily.dao.user.model.User;
import com.weijie.core.BaseDao;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface FamilyDao extends BaseDao<Family> {

	Family findRandomFamily(@Param("param")Map<String, Object> param);

	List<Family> findSystemFamily(@Param("memberCount") Integer memberCount);

	int getCountFansFamily(@Param("user_id")Long userId);

	List<Map<String,Object>> findRankFamily(@Param("time") String time);

	List<Map<String, Object>> searchFamilyMember(@Param("param")Map<String, Object> param, @Param("page")  Page page);

	List<Family> findFamilyBySuperId(@Param("super_id")Long superId);

	List<Long> getFamilyByRank(@Param("limit") Integer limit);

	List<Family> findFansFamily(@Param("param")Map<String, Object> param, @Param("page")Page page);
	
	Integer findFansFamilyCount(@Param("param")Map<String, Object> param);

	Family findByOwnerId(@Param("user_id")Long userId);

	int updateAnnouncementRead(@Param("family_id")Long family_id);

	List<User> findCanDeleteMember(@Param("param")Map<String, Object> param, @Param("page")Page page);

	Family findByIdForUpdate(Long id);

	List<Long> getAllFamilyId();

	Long getFamilyMemberNum(@Param("id")Long id);

	Long findFamilyByLastDelete(@Param("user_id")Long userId);
}